<template>
    <div class="game">
        <el-table :data="tableData" stripe style="width: 100%">
    <el-table-column prop="source" label="来源" width="100"/>
    <el-table-column prop="title" label="标题" width="180" />
    <el-table-column prop="description" label="详情" width="180"/>
  </el-table>
    </div>
</template>
<script>
import {game} from"../../api/dataapi.js"
import {reactive,toRefs,onMounted} from "vue"
export default {
    setup(){
        const data =reactive({
     tableData:[],
     total:0
   });
   let getData =()=>{
     game().then(r=>{
       data.tableData =r.data.newslist.splice(0,10);
       data.total =r.data.newslist.length
     })
   };
   onMounted(()=>{
     getData()
   })
return{
 ...toRefs(data)
}
    }
}
</script>
<style scoped>
.game{
    width: 900px;
}
</style>